package main

import "fmt"

func main() {
	var arrs = []int{1, 2, 3}
	for _, item := range arrs {
		go test(item)
	}

	for {
	}
}

func test(item int) {
	defer func() {
		if err := recover(); err != nil {
			fmt.Println("捕捉异常..........")
		}
	}()
	func(a int) {
		if a == 2 {
			panic("测试抛异常")
		}
		fmt.Println("a=", a)
	}(item)
}
